package com.proscenic.ops.common.config;

import com.proscenic.ops.common.filter.LogFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version 1.0
 * created by chenxin on 2021/11/3 16:00
 */
@Configuration
public class WebConfig {
    @Bean
    public FilterRegistrationBean registFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new LogFilter());
        registration.addUrlPatterns("/*");
        registration.setName("LogFilter");
        registration.addInitParameter("excludedUris", "/doc.html,/favicon.ico,/swagger-resources/**,/v3/api-docs,/webjars/**,/");
        registration.setOrder(1);
        return registration;
    }
}
